const $http = window.$http;
// 获取我的分组列表
export function getMyGroupList(params) {
  return $http.request({
    url: `/company/myCollection/groupList`,
    params,
  });
}

// 添加分组
export function addFavorGroup(data) {
  return $http.request({
    url: `/company/myCollection/addGroup`,
    method: "POST",
    data,
  });
}

// 删除分组 type:类型，0-解散分组，移动到默认分组；1-直接删除分组及其中的船
export function delFavorGroup(id, type) {
  return $http.request({
    url: `/company/myCollection/deleteGroup/${id}/${type}`,
    method: "DELETE",
  });
}

// 修改分组名称
export function editFavorGroupName(data) {
  return $http.request({
    url: `/company/myCollection/editGroup`,
    method: "PUT",
    data,
  });
}

// 添加船舶关注
export function addShipFavor(data) {
  return $http.request({
    url: `/company/myCollection/addShip`,
    method: "POST",
    data,
  });
}

// 取消关注船舶
export function cancelShipFavor(shipId) {
  return $http.request({
    url: `/company/myCollection/cancelCollection/${shipId}`,
  });
}

// 修改关注船舶的自定义名称
export function editFavorShipCustomName(data) {
  return $http.request({
    url: `/company/myCollection/editCollecitonShip`,
    method: "PUT",
    data,
  });
}

// 获取关注列表
export function getFavorList() {
  return $http.request({
    url: `/company/myCollection/list`,
  });
}

// 获取关注列表
export function getDynamicBriefPageList(params) {
  return $http.request({
    url: `/company/ship/getDynamicBriefPage`,
    params,
    errorTip: false
  });
}
